<meta charset="utf-8">
<style>
  #d1{
    
  font-size:100px;
      color:red;
  }
</style>
<div id="d1"></div>
<script>
    var i=10;
    var j=setInterval(f,1000);
    function f(){
        if(i>0){
           d1.innerHTML=i;
           i--; 
        }else{
           d1.innerHTML="时间到"; 
           clearInterval(j);  
      }
    }
 </script>